package com.gitee.wsl.prism4j.languages

import com.gitee.wsl.prism4j.Prism4j
import com.gitee.wsl.prism4j.Prism4j.Companion.grammar
import com.gitee.wsl.prism4j.Prism4j.Companion.pattern
import com.gitee.wsl.prism4j.Prism4j.Companion.token
import com.gitee.wsl.prism4j.Prism4j.Pattern

@Suppress("unused")
object Prism_brainfuck {
    fun create(prism4j: Prism4j): Prism4j.Grammar {
        return grammar(
            "brainfuck",
            token("pointer", pattern(Pattern.compile("<|>"), false, false, "keyword")),
            token("increment", pattern(Pattern.compile("\\+"), false, false, "inserted")),
            token("decrement", pattern(Pattern.compile("-"), false, false, "deleted")),
            token("branching", pattern(Pattern.compile("\\[|\\]"), false, false, "important")),
            token("operator", pattern(Pattern.compile("[.,]"))),
            token("comment", pattern(Pattern.compile("\\S+")))
        )
    }
}
